#pragma once
#include <boost/scoped_ptr.hpp>
#include <Engine/UnitEntityFwd.hpp>
#include <Engine/MapFwd.hpp>
#include <Engine/TerrainMaterialManager.hpp>
#include <Engine/UnitEntityManager.hpp>
#include "Engine/WorldPhysics.hpp"

namespace he
{
	class MapRenderer;
} /*he*/

//! This class is responsible for whole game run.
class GameFramework : boost::noncopyable
{
	// Typedefs
private:
	//! Unit entity vector.
	typedef std::vector<he::UnitEntityPtr_t> UnitEntityVector_t;

	// Attributes
private:
	//! Scene manager.
	Ogre::SceneManager &m_SceneManager;
	//! Terrain material manager.
	he::TerrainMaterialManager m_TerrainMatManager;
	//! Unit entity manager.
	he::UnitEntityManager m_UnitEntityManager;
	//! Map.
	he::MapPtr_t m_pMap;
	//! Map renderer.
	boost::scoped_ptr<he::MapRenderer> m_pMapRenderer;
	//! List of all unit entity.
	UnitEntityVector_t m_AllUnits;
	//! Global physics.
	he::WorldPhysics m_Physics;
	
	// Operations
public:
	//! Update data before frame is rendered.
	void update(float Time);

	// Construction/Destruction
public:
	GameFramework(boost::filesystem::path const &WorkPath, Ogre::SceneManager &SceneManager);
};
